package com.tledu.course.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tledu.course.mapper.ProjectManagementMapper;
import com.tledu.course.domain.ProjectManagement;
import com.tledu.course.service.IProjectManagementService;
import com.ruoyi.common.core.text.Convert;

/**
 * 专题管理Service业务层处理
 * 
 * @author Ghost
 * @date 2021-07-13
 */
@Service
public class ProjectManagementServiceImpl implements IProjectManagementService 
{
    @Autowired
    private ProjectManagementMapper projectManagementMapper;

    /**
     * 查询专题管理
     * 
     * @param projectId 专题管理ID
     * @return 专题管理
     */
    @Override
    public ProjectManagement selectProjectManagementById(Integer projectId)
    {
        return projectManagementMapper.selectProjectManagementById(projectId);
    }

    /**
     * 查询专题管理列表
     * 
     * @param projectManagement 专题管理
     * @return 专题管理
     */
    @Override
    public List<ProjectManagement> selectProjectManagementList(ProjectManagement projectManagement)
    {
        return projectManagementMapper.selectProjectManagementList(projectManagement);
    }

    /**
     * 新增专题管理
     * 
     * @param projectManagement 专题管理
     * @return 结果
     */
    @Override
    public int insertProjectManagement(ProjectManagement projectManagement)
    {
        projectManagement.setCreateTime(DateUtils.getNowDate());
        return projectManagementMapper.insertProjectManagement(projectManagement);
    }

    /**
     * 修改专题管理
     * 
     * @param projectManagement 专题管理
     * @return 结果
     */
    @Override
    public int updateProjectManagement(ProjectManagement projectManagement)
    {
        projectManagement.setUpdateTime(DateUtils.getNowDate());
        return projectManagementMapper.updateProjectManagement(projectManagement);
    }

    /**
     * 删除专题管理对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteProjectManagementByIds(String ids)
    {
        return projectManagementMapper.deleteProjectManagementByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除专题管理信息
     * 
     * @param projectId 专题管理ID
     * @return 结果
     */
    @Override
    public int deleteProjectManagementById(Integer projectId)
    {
        return projectManagementMapper.deleteProjectManagementById(projectId);
    }
}
